package com.arellomobile.android.push.utils.notification;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.util.DisplayMetrics;

public class Helper
{
  public static Bitmap getScaleBitmap(Bitmap paramBitmap, int paramInt, Context paramContext)
  {
    int i = (int)(paramInt * paramContext.getResources().getDisplayMetrics().density);
    return Bitmap.createScaledBitmap(paramBitmap, i * paramBitmap.getWidth() / paramBitmap.getHeight(), i, true);
  }

  // ERROR //
  public static Bitmap tryToGetBitmapFromInternet(String paramString, Context paramContext, int paramInt)
  {
    // Byte code:
    //   0: aload_0
    //   1: ifnull +213 -> 214
    //   4: aconst_null
    //   5: astore_3
    //   6: new 49	java/net/URL
    //   9: dup
    //   10: aload_0
    //   11: invokespecial 52	java/net/URL:<init>	(Ljava/lang/String;)V
    //   14: invokevirtual 56	java/net/URL:openConnection	()Ljava/net/URLConnection;
    //   17: astore 8
    //   19: aload 8
    //   21: invokevirtual 61	java/net/URLConnection:connect	()V
    //   24: aload 8
    //   26: invokevirtual 65	java/net/URLConnection:getInputStream	()Ljava/io/InputStream;
    //   29: astore_3
    //   30: new 67	java/io/ByteArrayOutputStream
    //   33: dup
    //   34: invokespecial 68	java/io/ByteArrayOutputStream:<init>	()V
    //   37: astore 9
    //   39: sipush 1024
    //   42: newarray byte
    //   44: astore 10
    //   46: aload_3
    //   47: aload 10
    //   49: invokevirtual 74	java/io/InputStream:read	([B)I
    //   52: istore 11
    //   54: iload 11
    //   56: iconst_m1
    //   57: if_icmpne +131 -> 188
    //   60: aload_3
    //   61: invokevirtual 77	java/io/InputStream:close	()V
    //   64: aload 9
    //   66: invokevirtual 78	java/io/ByteArrayOutputStream:close	()V
    //   69: aload 9
    //   71: invokevirtual 82	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   74: astore 12
    //   76: new 84	android/graphics/BitmapFactory$Options
    //   79: dup
    //   80: invokespecial 85	android/graphics/BitmapFactory$Options:<init>	()V
    //   83: astore 13
    //   85: aload 13
    //   87: iconst_1
    //   88: putfield 89	android/graphics/BitmapFactory$Options:inJustDecodeBounds	Z
    //   91: aload 12
    //   93: iconst_0
    //   94: aload 12
    //   96: arraylength
    //   97: aload 13
    //   99: invokestatic 95	android/graphics/BitmapFactory:decodeByteArray	([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
    //   102: pop
    //   103: aload 13
    //   105: getfield 99	android/graphics/BitmapFactory$Options:outWidth	I
    //   108: aload 13
    //   110: getfield 102	android/graphics/BitmapFactory$Options:outHeight	I
    //   113: invokestatic 108	java/lang/Math:max	(II)I
    //   116: istore 15
    //   118: fconst_1
    //   119: fstore 16
    //   121: iconst_m1
    //   122: iload_2
    //   123: if_icmpeq +22 -> 145
    //   126: iload 15
    //   128: i2f
    //   129: iload_2
    //   130: i2f
    //   131: aload_1
    //   132: invokevirtual 16	android/content/Context:getResources	()Landroid/content/res/Resources;
    //   135: invokevirtual 22	android/content/res/Resources:getDisplayMetrics	()Landroid/util/DisplayMetrics;
    //   138: getfield 28	android/util/DisplayMetrics:density	F
    //   141: fmul
    //   142: fdiv
    //   143: fstore 16
    //   145: aload 13
    //   147: iconst_0
    //   148: putfield 89	android/graphics/BitmapFactory$Options:inJustDecodeBounds	Z
    //   151: aload 13
    //   153: fload 16
    //   155: invokestatic 112	java/lang/Math:round	(F)I
    //   158: putfield 115	android/graphics/BitmapFactory$Options:inSampleSize	I
    //   161: aload 12
    //   163: iconst_0
    //   164: aload 12
    //   166: arraylength
    //   167: aload 13
    //   169: invokestatic 95	android/graphics/BitmapFactory:decodeByteArray	([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
    //   172: astore 17
    //   174: aload_3
    //   175: ifnull +7 -> 182
    //   178: aload_3
    //   179: invokevirtual 77	java/io/InputStream:close	()V
    //   182: invokestatic 120	java/lang/System:gc	()V
    //   185: aload 17
    //   187: areturn
    //   188: aload 9
    //   190: aload 10
    //   192: iconst_0
    //   193: iload 11
    //   195: invokevirtual 124	java/io/ByteArrayOutputStream:write	([BII)V
    //   198: goto -152 -> 46
    //   201: astore 6
    //   203: aload_3
    //   204: ifnull +7 -> 211
    //   207: aload_3
    //   208: invokevirtual 77	java/io/InputStream:close	()V
    //   211: invokestatic 120	java/lang/System:gc	()V
    //   214: aconst_null
    //   215: areturn
    //   216: astore 4
    //   218: aload_3
    //   219: ifnull +7 -> 226
    //   222: aload_3
    //   223: invokevirtual 77	java/io/InputStream:close	()V
    //   226: invokestatic 120	java/lang/System:gc	()V
    //   229: aload 4
    //   231: athrow
    //   232: astore 18
    //   234: goto -52 -> 182
    //   237: astore 7
    //   239: goto -28 -> 211
    //   242: astore 5
    //   244: goto -18 -> 226
    //
    // Exception table:
    //   from	to	target	type
    //   6	46	201	java/lang/Throwable
    //   46	54	201	java/lang/Throwable
    //   60	118	201	java/lang/Throwable
    //   126	145	201	java/lang/Throwable
    //   145	174	201	java/lang/Throwable
    //   188	198	201	java/lang/Throwable
    //   6	46	216	finally
    //   46	54	216	finally
    //   60	118	216	finally
    //   126	145	216	finally
    //   145	174	216	finally
    //   188	198	216	finally
    //   178	182	232	java/io/IOException
    //   207	211	237	java/io/IOException
    //   222	226	242	java/io/IOException
  }

  public static int tryToGetIconFormStringOrGetFromApplication(String paramString, Context paramContext)
  {
    int i = paramContext.getApplicationInfo().icon;
    if (paramString != null)
    {
      int j = paramContext.getResources().getIdentifier(paramString, "drawable", paramContext.getPackageName());
      if (j != 0)
        i = j;
    }
    return i;
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.arellomobile.android.push.utils.notification.Helper
 * JD-Core Version:    0.6.2
 */